import torch
from rich import print as pr
# print(torch.tensor([1,2,3]))
a=[1,2,3]
b=[4,5,6]
at=torch.tensor(a) # 创建张量
bt=torch.tensor(b)
aa=at.add(bt)     # z张量计算
aa_=at.add_(bt)
# print(aa)
# print(aa_,at)
# add sub mul div sum mean pow sqrt log2 log log10
# add_ sub_ mul_ div_  会改变源数据



c=torch.tensor([
    [1,2,3],
    [4,5,6],
    [7,8,9]
])
# print(c[[],1])


# 张量的形状
'''
reshape  转换维度 
squeeze unsqueeze 
transpose(data,1,2) 二维转置
permute(data,[1,2,3]) 三个维度转置
view()  转换维度 拍平
contigous

cat() 拼接
'''

print(c.shape)

